class MinStack {
public:
    /** initialize your data structure here. */
    stack<int> first;
    stack<int> minstack;
    MinStack() {
        minstack.push(INT_MAX);
    }
    
    void push(int x) {
        first.push(x);
        minstack.push(::min(minstack.top(),x));
    }
    
    void pop() {
        first.pop();
        minstack.pop();
    }
    
    int top() {
        return first.top();
    }
    
    int min() {
        return minstack.top();
    }
};

/**
 * Your MinStack object will be instantiated and called as such:
 * MinStack* obj = new MinStack();
 * obj->push(x);
 * obj->pop();
 * int param_3 = obj->top();
 * int param_4 = obj->min();
 */